<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="../../css/public.css" media="all">
    <style>
        body {
            background-color: #ffffff;
        }
    </style>
</head>
<body>
<div class="layui-form layuimini-form">
    <!-- 姓名 -->
    <div class="layui-form-item">
        <label class="layui-form-label required">姓名</label>
        <div class="layui-input-block">
            <input type="text" name="name" lay-verify="required" lay-reqtext="姓名不能为空" placeholder="请输入姓名" value="" class="layui-input">
            <tip>2-5 个汉字</tip>
        </div>
    </div>
    <!-- 学号 -->
    <div class="layui-form-item">
        <label class="layui-form-label required">密码</label>
        <div class="layui-input-block">
            <input type="number" name="number" lay-verify="required" lay-reqtext="学号不能为空" placeholder="请输入学号" value="" class="layui-input">
            <tip>数字</tip>
        </div>
    </div>
    <!-- 性别 -->
    <div class="layui-form-item">
        <label class="layui-form-label required">性别</label>
        <div class="layui-input-block">
            <input type="radio" name="sex" value="1" title="男" checked="">
            <input type="radio" name="sex" value="0" title="女">
        </div>
    </div>
    <!-- 籍贯-->
    <div class="layui-form-item" id="area-picker">
        <div class="layui-form-label">籍贯</div>
        <div class="layui-input-inline" style="width: 200px;">
            <select name="province" class="province-selector" data-value="广东省" lay-filter="province-1">
                <option value="">请选择省</option>
            </select>
        </div>
        <div class="layui-input-inline" style="width: 200px;">
            <select name="city" class="city-selector" data-value="深圳市" lay-filter="city-1">
                <option value="">请选择市</option>
            </select>
        </div>
        <div class="layui-input-inline" style="width: 200px;">
            <select name="county" class="county-selector" data-value="龙岗区" lay-filter="county-1">
                <option value="">请选择区</option>
            </select>
        </div>
    </div>
    <!-- 电话 -->
    <div class="layui-form-item">
        <label class="layui-form-label required">电话</label>
        <div class="layui-input-block">
            <input type="number" name="phone" lay-verify="required" lay-reqtext="电话不能为空" placeholder="请输入电话" value="" class="layui-input">
        </div>
    </div>
    <!-- 院系 -->
    <div class="layui-form-item">
        <label class="layui-form-label">院系</label>
        <div class="layui-input-block">
            <select name="college" lay-filter="college">
                <option value="">--请选择--</option>
                <option value="1">计算机科学与技术学院</option>
                <option value="2">机械学院</option>
                <option value="3">化学学院</option>
            </select>
        </div>
    </div>
    <!-- 专业 -->
    <div class="layui-form-item">
        <label class="layui-form-label">专业</label>
        <div class="layui-input-block">
            <select name="major" lay-filter="major">
                <option value="">--请选择--</option>
                <option value="1">计算机科学与技术</option>
                <option value="2">软件工程</option>
                <option value="3">智能科学与技术</option>
            </select>
        </div>
    </div>
    <!-- 校内职务 -->
    <div class="layui-form-item">
        <label class="layui-form-label">校内职务</label>
        <div class="layui-input-block">
            <select name="major" lay-filter="major">
                <option value=""></option>
                <option value="1" selected>无</option>
                <option value="2">班干部</option>
                <option value="3">学生会干部</option>
                <option value="4">社团干部</option>
            </select>
        </div>
    </div>
    <!-- 状态 -->
    <div class="layui-form-item">
        <label class="layui-form-label required">状态</label>
        <div class="layui-input-block">
            <input type="radio" name="state" value="1" title="正常" checked="">
            <input type="radio" name="state" value="0" title="退出">
            <input type="radio" name="state" value="2" title="毕业">
        </div>
    </div>
    <!-- 入学年份（年级） -->
    <div class="layui-form-item">
        <label class="layui-form-label required">入学年份</label>
        <div class="layui-input-block">
            <input id="date" type="text" name="year" lay-verify="required"  placeholder="请选择入学年份" value="" class="layui-input" readonly>
        </div>
    </div>
    <!-- 实验室职务 -->
    <div class="layui-form-item">
        <label class="layui-form-label">实验室职务</label>
        <div class="layui-input-block">
            <select name="major" lay-filter="major">
                <option value="">--请选择--</option>
                <option value="0">秘书长</option>
                <option value="1">副秘书长</option>
                <option value="2">技术总监</option>
                <option value="3">项目经理</option>
                <option value="4">组长</option>
            </select>
        </div>
    </div>
    <!-- 备注 -->
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">备注信息</label>
        <div class="layui-input-block">
            <textarea name="remark" class="layui-textarea" placeholder="请输入备注信息"></textarea>
        </div>
    </div>
    <!-- 确认保存 -->
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
        </div>
    </div>
</div>
<script src="../../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script src="../../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script>
    layui.use(['form','laydate','layarea'], function () {
        var form = layui.form,
            layer = layui.layer,
            laydate = layui.laydate,
            layarea = layui.layarea;
        $ = layui.$;

        //年选择器
        laydate.render({
            elem: '#date'
            ,type: 'year',
            max:'2021',
        });
        //籍贯
        layarea.render({
            elem: '#area-picker',
            // data: {
            //     province: '广东省',
            //     city: '深圳市',
            //     county: '龙岗区',
            // },
            change: function (res) {
                //选择结果
                console.log(res);
            }

        });

        //监听提交
        form.on('submit(saveBtn)', function (data) {
            var index = layer.alert(JSON.stringify(data.field), {
                title: '最终的提交信息'
            }, function () {

                // 关闭弹出层
                layer.close(index);

                var iframeIndex = parent.layer.getFrameIndex(window.name);
                parent.layer.close(iframeIndex);

            });

            return false;
        });

    });
</script>
</body>
</html>